// var logger = require('pomelo-logger').getLogger(__filename);
var pomelo = require('pomelo');
var dao = module.exports;

/**
 * Create Bag
 *
 * @param {Number} playerId Player Id
 * @param {function} cb Call back function
 */
dao.addHistory = function(id,details) {
	return
	setTimeout(function() {
		var sql = 'insert into History (id, details, time) values (?, ?, ?)';
		var args = [id, JSON.stringify(details),(new Date()).valueOf()];
		pomelo.app.get('dbclient').insert(sql, args, function(err, res) {
			console.log(res)
			if (err) {
				console.log('create bag for dao failed! ' + err.stack);
			}
		});
	},100)
};


dao.getHistory = function(id,cb) {
	return
	var sql = 'select * from History where id = ?';
	var args = [id];
	pomelo.app.get('dbclient').query(sql, args, function(err, res) {
		if (err) {
			console.log('create bag for dao failed! ' + err.stack);
			cb(false)
		} else {
			console.log(res)
			cb(res)
		}
	});
}